package com.storm.explore.interceptors;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author gu
 * @date 2020/5/7 11:27
 */
public class MyHandlerInterceptor implements HandlerInterceptor {


    /**
     * 返回值的属性将存放在Object中
     * 如果想要修改返回值，只需要修改ModelAndView.
     * */
    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {

    }

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        System.out.println("执行了默认的拦截器");
        return false;
    }
}
